package com.micro.modual.controller;

import com.micro.core.resp.RespJson;
import com.micro.core.resp.RespJsonData;
import com.micro.core.resp.RespJsonPageData;
import com.micro.modual.model.bo.goodsbrandauthorize.GoodsBrandAuthorizeBO;
import com.micro.modual.model.dto.goodsbrandauthorize.GoodsBrandAuthorizeDetailDTO;
import com.micro.modual.model.dto.goodsbrandauthorize.GoodsBrandAuthorizeListDTO;
import com.micro.modual.service.GoodsBrandAuthorizeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;

import java.util.Map;

/**
 * <h1>品牌资质授权表 控制器</h1>
 * @author levelcoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:27:47
 */
@Api(value = "品牌授权管理",tags = "品牌授权管理")
@RestController
@RequestMapping(value = "goodsBrandAuthorize")
public class GoodsBrandAuthorizeController {

    @Autowired
    private GoodsBrandAuthorizeService goodsBrandAuthorizeService;

    /**
     * <h2>查找品牌资质授权表 列表</h2>
     * @param params 列表查询请求对象
     * @return List<GoodsBrandAuthorizeListDTO> {@link GoodsBrandAuthorizeListDTO}s  品牌资质授权表 列表返回对象
     */
    @ApiOperation(value = "查询品牌资质授权表列表" ,notes = "查询品牌资质授权表列表")
    @GetMapping(value = "/findGoodsBrandAuthorizeList")
    public RespJsonPageData<GoodsBrandAuthorizeListDTO> findGoodsBrandAuthorizeList(@RequestParam  Map<String,Object> params){
        return goodsBrandAuthorizeService.findList(params,GoodsBrandAuthorizeListDTO.class);
    }

    /**
     * <h2>根据主键编号查看品牌资质授权表详情</h2>
     * @param id  品牌资质授权表 主键编号
     * @return {@link GoodsBrandAuthorizeDetailDTO}  品牌资质授权表 详情
     */
    @ApiOperation(value = "查询品牌资质授权表详情",notes = "根据主键编号，查询品牌资质授权表详情")
    @GetMapping(value = "/findGoodsBrandAuthorizeDetail/{id}")
    public RespJsonData<GoodsBrandAuthorizeDetailDTO> findGoodsBrandAuthorizeDetail(@PathVariable("id") Long id){
        return goodsBrandAuthorizeService.findDetail(id,GoodsBrandAuthorizeDetailDTO.class);
    }

    /**
     * <h2>新增品牌资质授权表详情</h2>
     * @param goodsBrandAuthorizeBO {@link GoodsBrandAuthorizeBO} 品牌资质授权表 新增/修改 请求对象
     * @return {@link RespJson} 返回结果基础类
     */
    @ApiOperation(value = "新增品牌资质授权表",notes = "新增品牌资质授权表")
    @PostMapping(value = "/addGoodsBrandAuthorize")
    public RespJson addGoodsBrandAuthorize(@RequestBody GoodsBrandAuthorizeBO goodsBrandAuthorizeBO){
        return goodsBrandAuthorizeService.addGoodsBrandAuthorize(goodsBrandAuthorizeBO);
    }

    /**
     * <h2>修改品牌资质授权表详情</h2>
     * @param goodsBrandAuthorizeBO  {@link GoodsBrandAuthorizeBO} 品牌资质授权表 新增/修改 请求对象
     * @return {@link RespJson} 返回结果基础类
     */
    @ApiOperation(value = "修改品牌资质授权表",notes = "修改品牌资质授权表")
    @PostMapping(value = "/editGoodsBrandAuthorize")
    public RespJson editGoodsBrandAuthorize(@RequestBody GoodsBrandAuthorizeBO goodsBrandAuthorizeBO){
        return goodsBrandAuthorizeService.editGoodsBrandAuthorize(goodsBrandAuthorizeBO);
    }

    /**
     * <h2>根据主键编号删除品牌资质授权表信息</h2>
     * @param id  品牌资质授权表 主键编号
     * @return  {@link RespJson} 返回结果基础类
     */
    @ApiOperation(value = "删除品牌资质授权表",notes = "根据地址ID，删除品牌资质授权表")
    @PostMapping(value = "/deleteGoodsBrandAuthorize/{id}")
    public RespJson deleteGoodsBrandAuthorize(@PathVariable("id") Long id){
        return goodsBrandAuthorizeService.deleteGoodsBrandAuthorize(id);
    }
}

